<h1>Notes</h1>
<!--notes list-->
<dl>	
<?php $pr=false; ?>
<?php foreach($notes as $note):?>	
	<dt>
		<?php $pr=true; ?>
		<?php echo $note->title." (".$note->publishtime.")";?>
		<a href="<?php echo site_url()."notes/delete/?id=".$note->id; ?>"><button>delete</button></a>
	</dt>
	<dd><?php echo $note->content;?></dd>
<?php endforeach;?>
</dl>
<?php if(!$pr): ?>
	No new notes.
<?php endif; ?>
<!--insert note-->
<h2>Add a new note:</h2>
<form method="POST" action="<?php echo site_url()."notes/insert"?>">
	<fieldset>
		<label for="title">note title *:</label>
		<input type="textbox" name="title" value="<?php echo $title; ?>" placeholder="note title"/>
	</fieldset>
	<fieldset>
		<label for="content">note content:</label>
		<textarea name="content" placeholder="note content"><?php echo $content; ?></textarea>
	</fieldset>
	<input type="submit" value="Add note"/>
</form>